<template>
  <div class="deletePop">
    <van-dialog
      @confirm="confirm"
      @cancel="cancel"
      v-model="myShow"
      title="Are you sure to delete?"
      show-cancel-button
    >
      <!-- <van-field class="markInput" v-model="mark" type="text" placeholder="Please enter the mark" /> -->
    </van-dialog>
  </div>
</template>
<script>
export default {
  name: 'cityPop',
  data() {
    return {
      myShow: false,
      mark: ''
    }
  },
  props: {
    show: {
      // 通过props传递给子组件的show，不能在子组件内部修改props中的show值。
      type: Boolean,
      default: false
    }
  },
  watch: {
    show: {
      handler(newValue, oldValue) {
        // console.log(newValue)
        if (newValue) {
          this.myShow = true
        } else {
          this.myShow = false
        }
      },
      deep: true
    }
  },
  methods: {
    confirm() {
      //   this.$emit('closePop')
      //   this.$router.replace({
      //     path: '/login'
      //   })
        this.$emit('confirmDelete')
    },
    cancel() {
      this.$emit('closePop')
    }
  }
}
</script>
<style lang="scss" scoped>
.deletePop {
  .markInput {
    /deep/ .van-field__control {
      background-color: #f2f2f2;

      padding-top: 5px;
      padding-bottom: 5px;
      text-indent: 10px;
    }
  }
}
</style>
